package com.fuint.application.dao.repositories;

import com.fuint.base.dao.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import com.fuint.application.dao.entities.MtGoodsSpec;
import java.util.List;

/**
 * mt_goods_spec Repository
 * Created by FSQ
 * Contact wx fsq_better
 * Site https://www.fuint.cn
 */
@Repository 
public interface MtGoodsSpecRepository extends BaseRepository<MtGoodsSpec, Integer> {

    /**
     * 获取商品规格行数
     *
     * @return
     */
    @Query("SELECT t.name FROM MtGoodsSpec t WHERE t.goodsId = :goodsId and t.status = 'A' group by t.name")
    List<Object[]> getGoodsSpecCountList(@Param("goodsId") Integer goodsId);
}

